import http from "@/utils/request";
export function saveConversationApi(data: any): Promise<Record<any, any>> {
    return http('/wx/dispatch/conversations/saveConversation',data, {
        loading: true,
        method: 'POST',
    });
}

export function customerMessageApi(): Promise<Record<any, any>> {
    return http('/dispatch/messages/merchantMessageList', {
        loading: true,
        method: 'GET',
    });
}

export function messagesListApi(conversationId: string, lastId: string): Promise<Record<any, any>> {
    return http(`/dispatch/messages/messagesList?conversationId=${conversationId}&size=20&lastId=${lastId}`, {
        loading: true,
        method: 'GET',
    });
}

/**
 * 评价
 */
export function merchantReviewsListApi(): Promise<Record<any, any>> {
    return http(`/wx/acceptance/reviews/merchantReviewsList`, {
        loading: true,
        method: 'GET',
    });
}

export function updateMessageStatusApi(params: any): Promise<Record<any, any>> {
    return http(`/dispatch/messages/updateMessageStatus?conversationId=${params.conversationId}&lastMessageId=${params.lastMessageId}`, {
        loading: true,
        method: 'GET',
    });
}

export function updateMessageStatusByTimestampApi(params: any): Promise<Record<any, any>> {
    return http(`/dispatch/messages/updateMessageStatusByTimestamp?conversationId=${params.conversationId}&timestamp=${params.timestamp}`, {
        loading: true,
        method: 'GET',
    });
}

export function createGroupChatApi(params: any): Promise<Record<any, any>> {
    return http(`/dispatch/messages/createGroupChat?conversationId=${params.conversationId}`, {
        loading: true,
        method: 'GET',
    });
}


